from masoniteorm.relationships import belongs_to

from application.config import appSettings
from ..base import BaseModel


class TenantTemplate(BaseModel):
    __connection__ = 'postgres'
    __table__ = appSettings.db_code_prefix + 'tenant_templates'

    __casts__ = {
        'theme_content': 'json',
    }

    # @belongs_to('brand_id', 'brand_id')
    # def brand(self):
    #     from ..oem.Company import Company
    #     return Company

    @belongs_to('code', 'code')
    def brand(self):
        from ..oem.Company import Company
        return Company


__all__ = ['TenantTemplate']
